package cn.tedu.store.mapper;

import cn.tedu.store.entity.*;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
@DS("master")
@Mapper
public interface RepairMapper {
    Integer insert(@Param(value = "repair") Repair repair);
    List<Repair> repairSelect(@Param(value = "phone") String phone, @Param(value = "deptId") String deptId);
    String repairSelectMaxId();
    List<Employee> selectEmployee(String phone);
    List<Department> selectDepartment();
    List<Repair> selectRepairOrder(@Param(value = "repairState") List<Integer> repairState);
    Date applyDate(RepariOrder repairOrder);
    //接单
    void updateByRepairapplyid(@Param(value = "repairApplyId") String repairApplyId,@Param(value = "repairOperator") String repairOperator,@Param(value = "repairAcceptDate") Date repairAcceptDate);
    Repair selectMyRepairOrderById(@Param(value = "repairApplyId") String repairApplyId,@Param(value = "repairState") String repairState);
    void cancelRepairOrder(@Param(value = "repairApplyId") String repairApplyId,@Param(value = "cancelDate") Date cancelDate);
    List<RepariOrder> selectAllRepairOrder(
            @Param(value = "repairApplyOperator") String repairApplyOperator,
            @Param(value = "stateOne") String stateOne,
            @Param(value = "stateTwo") String stateTwo,
            @Param(value = "repairStateOne") String repairStateOne,
            @Param(value = "repairStateTwo") String repairStateTwo
    );
    List<RepariOrder> selectAllRepairOrder3(
            @Param(value = "repairApplyOperator") String repairApplyOperator,
            @Param(value = "stateOne") String stateOne,
            @Param(value = "stateTwo") String stateTwo,
            @Param(value = "repairStateOne") String repairStateOne,
            @Param(value = "repairStateTwo") String repairStateTwo
    );
    //接单后点完成单子
    void updateAcceptState(@Param(value = "repairApplyId") String repairApplyId,@Param(value = "repairOperator") String repairOperator,@Param(value = "repairFinishedDate") Date repairFinishedDate);

    //获取信息科人员
    List<DutyTable> selectXxkPaiban();
    DutyTable getZ(String emplCode);

    //获取信息科人员
    List<DutyTable> selectXxkPaiban1();
    //获取信息科人员
    List<DutyTable> selectXxkPaiban2();
    //通过科室编号获取科室名称
    List<Department> selectDepartById(String DeptCode);

    //插入会议信息20211005
    //Integer insertMeeting(@Param(value = "meetingCheckRecode") MeetingCheckRecode meetingCheckRecode);
    Integer insertMeeting(MeetingCheckRecode meetingCheckRecode);

    //根据工号查询个人会议信息20211008
    List<MeetingCheckRecode> meetingSelect(@Param(value = "empCode") String empCode,@Param(value = "meetingCode") String meetingCode);

    //根据会议号和工号扫码参会签到（20211009）
    void updateMeetingRecode(@Param(value = "empBeginDate") Date empBeginDate,@Param(value = "empCode") String empCode,@Param(value = "meetingCode") String meetingCode);

    //根据工号查人员信息20211011
    List<Employee> selectEmployeeByCode(String employeeId);

    //根据会议号查会议信息20211011
    List<MeetingCheckRecode> meetingSelectById(String meetingCode);

    //发言、请假、替换参会20211011
    void updatePersonRecode(@Param(value = "reportState") String reportState,@Param(value = "leaveState") String leaveState,@Param(value = "replaceState") String replaceState,@Param(value = "empCode") String empCode,@Param(value = "meetingCode") String meetingCode);

    Integer insert1(@Param("repair") Repair repair);

    List<RepariOrder> selectAllRepairOrder2(String repairApplyOperator, String stateOne, String stateTwo, String repairStateOne, String repairStateTwo);
    List<RepariOrder> selectAllRepairOrder8(@Param("repairApplyOperator") String repairApplyOperator,@Param("stateOne")  String stateOne,@Param("stateTwo")  String stateTwo,@Param("repairStateOne")  String repairStateOne, @Param("repairStateTwo") String repairStateTwo);
    void updateSuggestion(@Param("repairApplyId")String repairApplyId,@Param("suggestion") String suggestion,@Param("repairEvaluate") String repairEvaluate);

    List<Repair> selectByToDateRepairAll(@Param("start")String start,@Param("end") String end);


    List<Repair> selectByToDateRepairLockout1(@Param("emplCode") String emplCode,@Param("start") Date start,@Param("end")  Date end);

    List<Repair> selectByToDateRepairLockout(@Param("emplCode")String emplCode, @Param("start")String format, @Param("end")String format1);

    void updateProgress(@Param("repairApplyId")String repairApplyId,@Param("progress") String progress);

    List<Repair> selcetT(@Param("start") String start,@Param("end")  String end);

    List<Repair> selcetUserAll(@Param("emplCode")String emplCode,@Param("start") String start,@Param("end")  String end);

    List<Repair> getWeRepairByRepairApplyOperator(String repairApplyOperator);

    Repair selectMyRepair(String repairApplyId);

    void upLaod(@Param("tImage") TImage tImage);

    TImage selcetTImage(String repairApplyId);

    void updateRepairApplyStateByRepair(@Param("repair1") Repair repair1);

    void updateRepairStateByRepairApplyId(@Param("repairApplyId") String repairApplyId,@Param("state") String state,@Param("date") Date date);

    void updateComplaintsByRepairapplyid(@Param("repairApplyId")String repairApplyId,@Param("message") String message);


    List<DutyTable> selectXxkPaiban5();

    void updateTime(@Param("repairApplyId")String repairApplyId,@Param("endTime") Date endTime);

    void upLaodRecording(@Param("recording") Recording recording);

    Recording getRecording(String repairApplyId);

    void upadtaEndTime2(@Param("repairApplyId")String repairApplyId,@Param("endTime") Date endTime);

    void updateOperator(@Param("repairApplyId")String repairApplyId,@Param("emplCode") String emplCode);

    void insertTransfer(@Param("transfer")Transfer transfer);

    List<Transfer> getAll();

    List<Repair> all();

    List<RepariOrder> selectDept(@Param("employeeDept") String employeeDept,@Param("stateOne") String stateOne,@Param("stateTwo") String stateTwo,@Param("repairStateOne") String repairStateOne,@Param("repairStateTwo") String repairStateTwo);


    List<Repair> selectRepair();

    List<RepariOrder> getRelevantPersonnel(String emplCode);

    List<Repair> selectTimeoutOrders(String i);


    void updateRepairRemind(@Param("repairApplyId") String repairApplyId,@Param("s") String s);

    List<Repair> getAllByRepairState(@Param("endTime") String endTime,@Param("startTime")  String startTime,@Param("repairState")  String repairState);

    void addAssign(@Param("repairApplyId")String repairApplyId,@Param("repairApplyOperator") String repairApplyOperator, @Param("date")Date date,@Param("repairOperator") String repairOperator,@Param("status") String status);

    List<Assign> selectAll(@Param("endTime") String endTime,@Param("startTime")  String startTime,@Param("repairState")  String repairState);

    List<RepariOrder> selectAllRepairOrder9(@Param("repairApplyOperator") String repairApplyOperator,@Param("stateOne")  String stateOne,@Param("stateTwo")  String stateTwo,@Param("repairStateOne")  String repairStateOne, @Param("repairStateTwo") String repairStateTwo);

    Repair getOne(@Param("w") WorkFlow w);

    Repair getById(@Param("w")WorkFlow w);
}
